/*
 * 亲密数_1（4分）
 */

#include <stdio.h>


int main() {
	setbuf(stdout, NULL);


	// NOTE: Variable declaration
	int m, n, factor_m = 1, factor_n = 1;


	// NOTE: Inputs
	printf("Input m, n:\n");
	scanf("%d,%d", &m, &n);


	// NOTE: Process
	for (int i = 2; i < m; ++i) {
		if (m % i == 0) {
			factor_m += i;
		}
	}

	for (int i = 2; i < n; ++i) {
		if (n % i == 0) {
			factor_n += i;
		}
	}


	// NOTE: Outputs
	if (factor_m == n && factor_n == m) {
		printf("Yes!\n");
	} else {
		printf("No!\n");
	}

	// NOTE: Ending
	return 0;
}